package com.example.flshtarvel.service;

import com.example.flshtarvel.entity.Article;
import com.example.flshtarvel.entity.Tag;
import com.example.flshtarvel.entity.TagArticleMap;
import com.example.flshtarvel.mapper.TagArticleMapMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TagArticleMapService {
    @Autowired(required = false)
    TagArticleMapMapper tagArticleMapMapper;

    public int insertTagArticleMap(String tagId,String articleId){
        return tagArticleMapMapper.insertTagArticleMap(tagId,articleId);
    }

    public int deleteTagArticleMapByArticleId(String articleId){
        return tagArticleMapMapper.deleteTagArticleMapByArticleId(articleId);
    }

    public List<Tag> selectTagByArticleId(String articleId){
        return tagArticleMapMapper.selectTagByArticleId(articleId);
    }

    public int deletetagArticleMapByTagId(String tagId){
        return tagArticleMapMapper.deletetagArticleMapByTagId(tagId);
    }

    public List<TagArticleMap> selectArticleByTagId(String tagId){
        return tagArticleMapMapper.selectArticleByTagId(tagId);
    }
}
